Quiz 2
Question # 1
Consider we have two tables A and B each with one only one column.
Table A
ID |
---|
1 |
5 |
Table B
Name |
---|
Alex |
John |
What will be the output of running the below query:
DELETE A, B FROM A, B WHERE A.id in (-7);
A)
None of the data is deleted
B)
Data from both the tables is deleted
C)
Data from table B is deleted but not from table A
Question # 2
If we change the query in the previous question as follows:
DELETE A, B FROM A, B WHERE A.id in (1);
What will be the output of running the below query:
A)
All the data in table B is deleted and none is deleted in table A
B)
All the data in table B is deleted and one row is deleted in table A
C)
None of the data is deleted
Question # 3
In what order are the various clauses evaluated from left to right?
A)
SELECT FROM WHERE GROUP BY LIMIT ORDER-BY
B)
FROM WHERE SELECT GROUP-BY HAVING ORDER-BY LIMIT
C)
SELECT FROM WHERE HAVING LIMIT GROUP-BY ORDER-BY LIMIT
Question # 4
What are partial indexes?
A)
Partial indexes are also known as filtered indexes and include only a subset of rows of a table rather than the entire table. The rows are selected for indexing based on some specified condition.
B)
Partial indexes are declared on rows values rather than column names.
C)
Partial indexes work on a combination of two or more tables.
Question # 5
What is the difference between clustered and non-clustered index?
A)
In case of clustered index, the table is itself stored on disk as an index, usually, as a B+ tree. Whereas, in the case of a non-clustered index, the table is stored in the order as the rows are inserted and any declared indexes exist as separate data-structures on the disk.
B)
Indexes in MySQL are known as clustered indexes whereas they are known as non-clustered indexes in SQL implementations by other vendors.
C)
Clustered indexes merge two indexes into one and thus are called clustered, whereas non-clustered indexes consist of a single index.